home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1993 / MacHack 1993.toast / MacHack™ 1987-1992 / MacHack™ '90 / Source Code ƒ / MPW C ƒ / C Include ƒ / Instructions < prev   
Encoding:
Text File  |  1990-03-30  |  3.2 KB  |  94 lines  |  [TEXT/MPS ]

  1. Instructions for use of CIncludesTool    -- John Jeppson
  2.  
  3.  
  4. Description:
  5.  
  6.     CIncludesTool is an MPW tool which locates a C or C++ identifier in
  7.     the {CIncludes} file where it is first used.  The tool then generates
  8.     the appropriate "#include <file>" instruction for your program.  A
  9.     dictionary of all the indentifiers is generated and stored in
  10.     your system folder, so using the tool is quite efficient.  
  11.     
  12.     CIncludesTool is supplied as source code which you may modify and use
  13.     on your own system.  The accompanying source code files are Copyright
  14.     1990 by John Jeppson and may not be sold or distributed for profit
  15.     without my permission.  
  16.     
  17.  
  18. Installation:
  19.  
  20.     1. Build "CIncludesCode" using the enclosed ".make" file.
  21.  
  22.     2. Drag the resulting "CIncludesCode" file to your MPW {tools} folder.
  23.  
  24.     3. Drag the script file "CIncludesTool" to your MPW {tools} folder.
  25.  
  26.     4. From your worksheet execute: "CIncludesTool -m". This command generates
  27.         the indentifier dictionary and saves it in your system folder in a
  28.         file called "CIncludesData".  If you change the files in your
  29.         {CIncludes} folder then repeat this step.
  30.         
  31.     5. Create menu/keyboard commands for the tool by placing the following
  32.         instructions in your "UserStartup" file:
  33.  
  34.             AddMenu Edit 'CIncludesLocate/0'   'CIncludesTool -f'
  35.             AddMenu Edit 'CIncludesReformat/9' 'CIncludesTool -i'
  36.  
  37.         Note that these commands use Cmd-0 and Cmd-9 as the keyboard
  38.         equivalents.  Change them to whatever you want.  
  39.         
  40.         
  41. Usage:
  42.  
  43.     When the C or C++ compiler complains that a Mac toolbox name or
  44.     other "system" identifier is undefined, select the indentifier
  45.     in your program text and press "Cmd-0". The appropriate "#include"
  46.     instruction will be inserted at the top of your program text file in
  47.     the active window.
  48.     
  49.     A series of "#include" instructions may be condensed by eliminating
  50.     duplicates and dependencies. Just select all the lines containing
  51.     "#include" instructions and press Cmd-9.
  52.     
  53.  
  54. Internals:
  55.  
  56.     The file "CIncludesTool" is an MPW script which must be called with
  57.     a single parameter:
  58.     
  59.         -m  Rebuilds the CIncludes identifier dictionary.
  60.         -f  Locates selection from active window.
  61.         -i  Reformates "include" statements in {Active}.§ 
  62.  
  63.  
  64.     "CIncludesTool" script, in turn, calls "CIncludesCode", an MPW tool
  65.     written in C, supplying various parameters.  {1} must be: 
  66.  
  67.         -m  Rebuilds the CIncludes identifier dictionary file
  68.         -v  Checks if {2} is a valid C identifier string
  69.         -f  Attempts to locate {2} in identifier dictionary
  70.         -i  Reformates "include" statements in {Active}.§ 
  71.     
  72.     "CIncludesCode" writes error messages, if any, to StdErr.
  73.     Also:
  74.  
  75.         (-m) writes progress messages to StdErr so that
  76.                 they will be displayed when written.
  77.  
  78.         (-f) writes output to {Active} window at the window top (or
  79.                 to the next line if you comment out the appropriate
  80.                 line in "CIncludesTool" script).  
  81.  
  82.         (-i) replaces selection in active window with list of
  83.                 include statements. Any comments following
  84.                 previous include statements will be lost.
  85.     
  86.  
  87.     "CIncludesCode" also returns one of the following status codes:
  88.  
  89.         0    Okay
  90.         1    Bad Parameters
  91.         2    Invalid identifier string in {2}
  92.         3    Out of Memory
  93.         4    Unable to locate identifier {2} in dictionary
  94.